package com.interview.juc;

import java.io.FileInputStream;
import java.io.FileOutputStream;

/**
 * Copyright (C), 2018-2020
 * FileName: 文件复制
 * Author:   kongfanyu
 * Date:     2020/12/28 下午4:56
 */
public class 文件复制 {
    public static void main(String[] args) throws Exception {
        FileInputStream fis = new FileInputStream("account.txt");
        FileOutputStream fos = new FileOutputStream("account2.txt");
        byte [] buf = new byte[1024];
        int len = 0;
        while ( (len = fis.read(buf)) != -1 ){
            fos.write(buf,0,len);
        }
        fos.close();
        fis.close();
    }
}
